<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/12/14 0014
  Time: 9:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title><c>></title>
</head>
<body>
<c:set var="name" value="WSQ" scope="request"></c:set>
<%--<c:remove var="name" scope="request"></c:remove>--%>
name:<c:out value="${name}" default="null"></c:out><br/>
<c:if test="${name=='WSQ'}" var="a1" scope="request">
    第一个if进入成功<br/>
</c:if>
<c:if test="${!a1}">
    第二个if进入成功
</c:if>

<c:set var="i" value="2" scope="request"></c:set>
<c:choose>
    <c:when test="${requestScope.i==1}">i==1</c:when>
    <c:when test="${requestScope.i==2}">i==2</c:when>
    <c:when test="${requestScope.i==3}">i==3</c:when>
    <c:otherwise>其他情况</c:otherwise>
</c:choose><br/>

<c:forEach items="a,c,z,h,b" step="1" var="list" begin="0" end="4" varStatus="listInfo">
    <br/>${list}本次循环的值<br/>
    ${listInfo.index}慈祥的索引，从0开始<br/>
    ${listInfo.count}此项的计数序号，从1开始<br/>
    ${listInfo.first}是否为第一项<br/>
    ${listInfo.last}是否为最后一项<br/>
    ${listInfo.begin}从第几个开始索引<br/>
    ${listInfo.end}到第几个结束索引<br/>
    ${listInfo.step}本次隔几行迭代<br/>
</c:forEach><br/><br/>

<%
    List<Map<String,Object>> studentList=new ArrayList<>();
    Map<String,Object> stu1=new HashMap<>();
    Map<String,Object> stu2=new HashMap<>();
    Map<String,Object> stu3=new HashMap<>();
    stu1.put("name","小A");
    stu1.put("age",13);
    stu1.put("sex","男");
    stu2.put("name","小B");
    stu2.put("age",14);
    stu2.put("sex","男");
    stu3.put("name","小C");
    stu3.put("age",15);
    stu3.put("sex","女");
    studentList.add(stu1);
    studentList.add(stu2);
    studentList.add(stu3);
    request.setAttribute("students",studentList);
%>
<table border="1">
    <c:forEach items="${students}" var="map" step="1">
        <tr>
            <td>name：${map.name}</td>
            <td>age：${map.age}</td>
            <td>sex：${map.sex}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
